package com.yuqih.common.dao;

import java.util.List;

import com.yuqih.common.dto.PageMetadata;

public interface ICommonDao {
	
	<T> int insert(Class<T> type, T entity);
	
	<T> int insertBatch(Class<T> type, List<T> entities);
	
	<T> int update(Class<T> type, T entity);
	
	<T> int updateBatch(Class<T> type, List<T> entities);
	
	<T> int delete(Class<T> type, Object id);
	
	<T> int deleteBatch(Class<T> type, List<?> ids);
	
	<T> T selectById(Class<T> type, Object id);
	
	<T> List<T> selectList(Class<T> type, Object condition, PageMetadata pageMetadata);
	
	<T> int count(Class<T> type, Object condition);
		
}
